Optimal. Leaf size=109 \[ -\frac {A+i B}{d \sqrt {a+i a \tan (c+d x)}}-\frac {(A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3592, 3526, 3480, 206} \[ -\frac {A+i B}{d \sqrt {a+i a \tan (c+d x)}}-\frac {(A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 3480
Rule 3526
Rule 3592
Rubi steps
\begin {align*} \int \frac {\tan (c+d x) (A+B \tan (c+d x))}{\sqrt {a+i a \tan (c+d x)}} \, dx &=-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d}+\int \frac {-B+A \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx\\ &=-\frac {A+i B}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {(i A+B) \int \sqrt {a+i a \tan (c+d x)} \, dx}{2 a}\\ &=-\frac {A+i B}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {(A-i B) \operatorname {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d}\\ &=-\frac {(A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {A+i B}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i B \sqrt {a+i a \tan (c+d x)}}{a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.71, size = 140, normalized size = 1.28 \[ -\frac {e^{-2 i (c+d x)} \sqrt {\frac {a e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}} \left ((A-i B) e^{i (c+d x)} \sqrt {1+e^{2 i (c+d x)}} \sinh ^{-1}\left (e^{i (c+d x)}\right )+A \left (1+e^{2 i (c+d x)}\right )+i B \left (1+5 e^{2 i (c+d x)}\right )\right )}{\sqrt {2} a d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.57, size = 333, normalized size = 3.06 \[ -\frac {{\left (a d \sqrt {\frac {2 \, A^{2} - 4 i \, A B - 2 \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (\frac {{\left ({\left (4 i \, A + 4 \, B\right )} a e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left (2 i \, a d e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i \, a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {2 \, A^{2} - 4 i \, A B - 2 \, B^{2}}{a d^{2}}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - a d \sqrt {\frac {2 \, A^{2} - 4 i \, A B - 2 \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (\frac {{\left ({\left (4 i \, A + 4 \, B\right )} a e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left (-2 i \, a d e^{\left (2 i \, d x + 2 i \, c\right )} - 2 i \, a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {2 \, A^{2} - 4 i \, A B - 2 \, B^{2}}{a d^{2}}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) + 2 \, \sqrt {2} {\left ({\left (A + 5 i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + A + i \, B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{4 \, a d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (B \tan \left (d x + c\right ) + A\right )} \tan \left (d x + c\right )}{\sqrt {i \, a \tan \left (d x + c\right ) + a}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.25, size = 88, normalized size = 0.81 \[ \frac {-2 i B \sqrt {a +i a \tan \left (d x +c \right )}-\frac {\sqrt {a}\, \left (-i B +A \right ) \sqrt {2}\, \arctanh \left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2}-\frac {a \left (i B +A \right )}{\sqrt {a +i a \tan \left (d x +c \right )}}}{d a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.74, size = 110, normalized size = 1.01 \[ \frac {\sqrt {2} {\left (A - i \, B\right )} a^{\frac {3}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) - 8 i \, \sqrt {i \, a \tan \left (d x + c\right ) + a} B a - \frac {4 \, {\left (A + i \, B\right )} a^{2}}{\sqrt {i \, a \tan \left (d x + c\right ) + a}}}{4 \, a^{2} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.38, size = 141, normalized size = 1.29 \[ -\frac {A}{d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}-\frac {B\,1{}\mathrm {i}}{d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}-\frac {B\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,2{}\mathrm {i}}{a\,d}-\frac {\sqrt {2}\,B\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{2\,\sqrt {-a}\,d}-\frac {\sqrt {2}\,A\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {a}}\right )}{2\,\sqrt {a}\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (A + B \tan {\left (c + d x \right )}\right ) \tan {\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________